def generator1():
    time = 0
    while True:
        time += 1
        res = yield time
        if res == 'over':
            return 'all is over'
        elif res is None:
            print('no input value')
        else:
            print('input value: %s' % res)


if __name__ == '__main__':
    g = generator1()
    print(next(g))
    # print(g.send(1000))
    # print(next(g))
    for i in range(0, 10):
        print(g.send(i))







